package com.surfilter.massdata.spark.model;


import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.surfilter.massdata.spark.model.DnsStatConsts.JobTypeName;

/**
 * 
 * oracle 常量类
 * @author liuchen
 *
 */
public class OracleConsts {

	public static final String ORACLE_DRIVER = "oracle.jdbc.driver.OracleDriver";
	public static final String MYSQL_DRIVER = "com.mysql.jdbc.Driver";
	public static final String IP_TABLE_NAME = "BR2002";

	// fields
	public static final String FIELD_ID = "ID";
	public static final String FIELD_BEGIN_IP = "BEGIN_IP";
	public static final String FIELD_END_IP = "END_IP";
	public static final String FIELD_BENGIN_IP_VALUE = "BENGIN_IP_VALUE";
	public static final String FIELD_END_IP_VALUE = "END_IP_VALUE";
	public static final String FIELD_ISP_ID = "ISP_ID";
	public static final String FIELD_IP_TYPE = "IP_TYPE";
	public static final String FIELD_OPERATORS_ID = "OPERATORS_ID";
	public static final String FIELD_OPERATORS_NAME = "OPERATORS_NAME";
	public static final String FIELD_OPERATORS_JYXKZBH = "OPERATORS_JYXKZBH";
	public static final String FIELD_ISP_NAME = "ISP_NAME";
	public static final String FIELD_ISP_JYXKZBH = "ISP_JYXKZBH";
	public static final String FIELD_PROVINCE = "PROVINCE";
	public static final String FIELD_CITY = "CITY";
	public static final String FIELD_COUNTY = "COUNTY";
	public static final String FIELD_ADDR = "ADDR";
	public static final String FIELD_HOUSE_CODE = "HOUSE_CODE";
	public static final String FIELD_HOUSE_NAME = "HOUSE_NAME";
	public static final String FIELD_IP_USED_TYPE = "IP_USED_TYPE";
	public static final String FIELD_BANDWIDTH = "BANDWIDTH";
	public static final String FIELD_USING_UNIT_NAME = "USING_UNIT_NAME";
	public static final String FIELD_USING_UNIT_LINKMAN = "USING_UNIT_LINKMAN";
	public static final String FIELD_USING_UNIT_TEL = "USING_UNIT_TEL";
	public static final String FIELD_USING_UNIT_TYPE = "USING_UNIT_TYPE";
	public static final String FIELD_USING_UNIT_INDUSTRY_TYPE = "USING_UNIT_INDUSTRY_TYPE";
	public static final String FIELD_REMARK = "REMARK";
	public static final String FIELD_SOURCE_UNIT = "SOURCE_UNIT";

	public static Map<JobTypeName, List<String>> typeFields;

	static {
		// 按照定义的顺序
		typeFields = new HashMap<JobTypeName, List<String>>();
		typeFields.put(JobTypeName.TPDMN_COUNT, Arrays.asList(OracleField.YEAR,
				OracleField.HALF_YEAR, OracleField.QUARTER, OracleField.MONTH, OracleField.WEEK,
				OracleField.DAY, OracleField.BUSS_TYPE, OracleField.BUSS_VALUE,
				OracleField.COUNT_VALUE, OracleField.STA_RANGE));
		typeFields.put(JobTypeName.DOMAIN_COUNT,
				typeFields.get(JobTypeName.TPDMN_COUNT));
		typeFields.put(JobTypeName.CIP_COUNT, Arrays.asList(OracleField.YEAR,
				OracleField.HALF_YEAR, OracleField.QUARTER, OracleField.MONTH, OracleField.WEEK,
				OracleField.DAY, OracleField.HOUR, OracleField.BUSS_TYPE, OracleField.BUSS_VALUE,
				OracleField.COUNT_VALUE, OracleField.STA_RANGE));
		typeFields.put(JobTypeName.TPDMN_VISIT, Arrays.asList(OracleField.YEAR,
				OracleField.HALF_YEAR, OracleField.QUARTER, OracleField.MONTH, OracleField.WEEK,
				OracleField.DAY, OracleField.BUSS_TYPE, OracleField.BUSS_VALUE, OracleField.RANK,
				OracleField.DOMAIN, OracleField.WEBSITE_NAME, OracleField.ICP_NUM,
				OracleField.TRAFFIC, OracleField.STA_RANGE));
		typeFields.put(JobTypeName.TPDMN_VISIT_HOUR, Arrays.asList(OracleField.YEAR,
				OracleField.HALF_YEAR, OracleField.QUARTER, OracleField.MONTH, OracleField.WEEK,
				OracleField.DAY, OracleField.HOUR, OracleField.BUSS_TYPE, OracleField.BUSS_VALUE,
				OracleField.RANK, OracleField.DOMAIN, OracleField.WEBSITE_NAME,
				OracleField.ICP_NUM, OracleField.TRAFFIC, OracleField.STA_RANGE));
        typeFields.put(JobTypeName.CIP_VISIT, Arrays.asList(OracleField.YEAR,
                OracleField.HALF_YEAR, OracleField.QUARTER, OracleField.MONTH, OracleField.WEEK,
                OracleField.DAY, OracleField.HOUR, OracleField.COUNT_VALUE, OracleField.BUSS_TYPE,
                OracleField.BUSS_VALUE, OracleField.CLIENT_IP, OracleField.STA_RANGE, OracleField.RANK));
        typeFields.put(JobTypeName.BEHAVIOR_TOPN_POP, Arrays.asList(OracleField.YEAR,
                OracleField.HALF_YEAR, OracleField.QUARTER, OracleField.MONTH, OracleField.WEEK,
                OracleField.DAY, OracleField.HOUR, OracleField.BUSS_TYPE, OracleField.BUSS_VALUE,
                OracleField.COUNT_VALUE, OracleField.STA_RANGE, OracleField.RANK));
        typeFields.put(JobTypeName.HIS_HANDLE, Arrays.asList(OracleField.YEAR,
                OracleField.HALF_YEAR, OracleField.QUARTER, OracleField.MONTH, OracleField.WEEK,
                OracleField.DAY, OracleField.BUSS_TYPE, OracleField.BUSS_VALUE,
                OracleField.COUNT_VALUE, OracleField.STA_RANGE));
	}
}
